
	
	
function uploadStartMe_2(file)
{
	
	try {
		/* I don't want to do any file validation or anything,  I'll just update the UI and
		return true to indicate that the upload should start.
		It's important to update the UI here because in Linux no uploadProgress events are called. The best
		we can do is say we are uploading.
		 */
		var progress = new FileProgress(file, this.swfu.customSettings.progressTarget);
		progress.setStatus("Uploading...");
		progress.toggleCancel(true, this);
	}
	catch (ex) {
		var a;
		
	}
	
	
	
	
	var a = this.swfu.getStats().files_queued;
	this.swfu.addPostParam("file_id", file.id);
	if (a == '1'){
		this.swfu.addPostParam("is_end", "true");
		
		time_remain = 0;
		file_use_id = file.id;
		timer = setTimeout("waitTimeout()", 40);
		
	}
	else{
		this.swfu.addPostParam("is_end", "false");
	}
	
	return true;
}
function upFailSetHtml(file_id, message){
	var m = window.uploadReslut;
	var tr = document.getElementById(file_id);
	if (tr != null){
		tr.style.color="red";
	}
	var bar = document.getElementById(file_id+"_bar");
	if(bar != null){
		bar.parentNode.innerHTML=m['fail'] +" "+ message;
	}
	else{
		var stat = document.getElementById(file_id+"_id_uploadTD_state");
		if (stat != null){
			stat.innerHTML = m['fail'] +":" + message;
		}
	}
	var delObject = document.getElementById(file_id+"_del");	
	if (delObject != null){
		delObject.parentNode.innerHTML="&nbsp;";
	}
}
function uploadSuccessMe(file, reslut) {
	
	var m = window.uploadReslut;
		
		var is_end = reslut['is_end'];
		if(is_end == 'true'){
			clearTimeout(timer);
			time_remain = -1;
			var error = reslut['error'];
			var files_id = reslut['files_id'];
			var cont_id = reslut['content_file_id'];
			if (error != null){
				upFailSetHtml(cont_id, m[error]);
				for(i=0; i<files_id.length; i++){
					upFailSetHtml(files_id[i], m[error]);
				}
				var stat = this.swfu.getStats();
				stat.successful_uploads = stat.successful_uploads - files_id.length;
				if (cont_id != null){
					stat.successful_uploads = stat.successful_uploads - 1;
				}
				this.swfu.setStats(stat);
			}else{
				for(i=0; i<files_id.length; i++){
					var r = reslut[files_id[i]];
					if (r != 'success'){
						upFailSetHtml(files_id[i], m[r]);
						var stat = this.swfu.getStats();
						stat.successful_uploads = stat.successful_uploads - 1;
						this.swfu.setStats(stat);
					}
				}
			}
		}
		
	
}

